import 'package:p_location/common/obj/base_filter_option.dart';

class AccidentTypeObj extends BaseFilterOption {
  int id;
  String childid;
  String childname;
  String parentid;
  String parentname;

  AccidentTypeObj(
      {this.id, this.childid, this.childname, this.parentid, this.parentname});

  factory AccidentTypeObj.fromJson(Map<String, dynamic> json) {
    return AccidentTypeObj(
      id: json['id'],
      childid: json['childid'] ?? '',
      childname: json['childname'] ?? '',
      parentid: json['parentid'] ?? '',
      parentname: json['parentname'] ?? '',
    );
  }

  @override
  getCode() {
    return childid;
  }

  @override
  getName() {
    return childname;
  }
}
